const express = require("express");
const router = express.Router()
const {authMiddleware} = require('../middleware/admin/auth_middleware')

const ArticlesController = require('../controller/articles')

router.post('/',authMiddleware,ArticlesController.createArticle)    //创建

router.get('/',ArticlesController.getArticles)       //获取全局文章
router.get('/follow',authMiddleware,ArticlesController.getFollowArticle)    //获取关注着文章
router.get('/:slug',authMiddleware,ArticlesController.getArticle) //获取单个

router.put('/:slug',authMiddleware,ArticlesController.updateArticles)    //更新
router.delete('/:slug',authMiddleware,ArticlesController.deleteArticles) //删除


module.exports = router
